<?php
echo $header;
echo $column_left;
echo $column_right;
$width_content = '100%';
if (($column_left) && ($column_right)) {
    $width_content = '48%';
} elseif (($column_left) || ($column_right)) {
    $width_content = '74%';
}
$style = '';
if ($column_left) {
    $style .= '; margin-left:1%';
}
if ($column_right) {
    $style .= '; margin-right:1%';
}
?>
<div class="content" style="width:<?php echo $width_content . $style; ?>"><?php echo $content_top; ?>
    <div class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
            <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
    </div>
    <ul data-role="listview" data-divider-theme="a">
        <li data-role="list-divider"><h1><?php echo $heading_title; ?></h1></li>
    </ul><br />
    <?php if ($categories) { ?>
        <p><b><?php echo $text_index; ?></b>
            <?php foreach ($categories as $category) { ?>
                &nbsp;&nbsp;&nbsp;<a data-role="button" data-inline="true" href="index.php?route=product/manufacturer#<?php echo $category['name']; ?>"><b><?php echo $category['name']; ?></b></a>
            <?php } ?>
        </p>
        <ul class="manufacturer-list" data-role="listview">
            <?php foreach ($categories as $category) { ?>
                <li data-role="list-divider" class="manufacturer-heading"><?php echo $category['name']; ?><span id="<?php echo $category['name']; ?>"></span></li>
                <?php if ($category['manufacturer']) { ?>
                    <?php for ($i = 0; $i < count($category['manufacturer']);) { ?>
                        <?php $j = $i + ceil(count($category['manufacturer']) / 4); ?>
                        <?php for (; $i < $j; $i++) { ?>
                            <?php if (isset($category['manufacturer'][$i])) { ?>
                                <li class="manufacturer-content"><a href="<?php echo $category['manufacturer'][$i]['href']; ?>"><?php echo $category['manufacturer'][$i]['name']; ?></a></li>
                            <?php } ?>
                        <?php } ?>
                    <?php } ?>
                <?php } ?>
            <?php } ?>
        </ul>
        <br />
    <?php } else { ?>
        <div class="content"><?php echo $text_empty; ?></div>
        <div class="buttons">
            <div class="right"><a data-role="button" href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
        </div>
    <?php } ?>
    <?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>